package com.vietnam.power.persitence;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * The persistent class for the sub_product_group database table.
 * 
 */
@Entity
@Table(name = "sub_product_group")
public class SubProductGroup implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private ProductGroup productGroup1;
	private ProductGroup productGroup2;

	public SubProductGroup() {
	}

	public SubProductGroup(int id) {
		this.id = id;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	// bi-directional many-to-one association to ProductGroup
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "child_id")
	public ProductGroup getProductGroup1() {
		return this.productGroup1;
	}

	public void setProductGroup1(ProductGroup productGroup1) {
		this.productGroup1 = productGroup1;
	}

	// bi-directional many-to-one association to ProductGroup
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	public ProductGroup getProductGroup2() {
		return this.productGroup2;
	}

	public void setProductGroup2(ProductGroup productGroup2) {
		this.productGroup2 = productGroup2;
	}

}